fix: prevent notification close buttons from submitting forms - #408
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough通知组件的关闭按钮新增 Changes通知关闭按钮行为
Estimated code review effort: 1(简单)| ~5 分钟 Merge Risk: ⚪ Minimal · up to The close control now avoids unintentionally submitting forms when notifications are mounted inside them, with regression coverage and validation completed; no actionable merge-blocking risk remains. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #408 +/- ##
=======================================
Coverage 99.20% 99.20%
=======================================
Files 12 12
Lines 376 376
Branches 102 102
=======================================
Hits 373 373
Misses 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
type="button"on the built-in notification close controlNative buttons default to
type="submit". Notifications can be mounted into a custom container inside a form, so clicking the built-in close control could otherwise submit an unrelated form. The action buttons in this repository already use explicit button types; this aligns the close control with that contract.Verification
typenpm run tscnpm run lint— 0 errors, 10 pre-existing warningsnpm run compile— ESM, CJS, declarations, and Less compilation passedgit diff --checkI found no open issue or PR addressing notification close-button submission, and audited all current open PR changed files before submission.
AI assistance disclosure: Codex was used to audit native-button defaults, check open work for overlap, add the regression, and run verification. The exact-base failure and final one-attribute runtime change were reviewed locally.
Summary by CodeRabbit